    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客列表页</title>
    <link rel="stylesheet" href="./css/normal.css">
    <link rel="stylesheet" href="./css/list.css">
</head>
<body>
    <div class="nav">
        <img src="./pic/dog.png" alt="">
        <span class="blog_title">我的博客系统</span>
        <span class="space"></span>
        <a href="#"  class="nav_span">主页</a>
        <a href="./edit.html" class="nav_span">写博客</a>
        <a href="logout" class="nav_span">注销</a>
        <a href="http://www.liuda066.cn" target="_blank" class="nav_span">自己的小破站</a>
    </div>

    <div class="container">
        <div class="left">
            <div class="card">
                    <img src="./pic/src.jpg" alt="">
                
                    <h3>六道牛牛</h3>
                    <a href="https://gitee.com/liuda066/">Github地址</a>
                <div class="row">
                    <span>文章</span>
                    <span>分类</span>
                </div>
                <div class="row">
                    <span>2</span>
                    <span>1</span>
                </div>
            </div>
        </div>

        <div class="right">
            <!-- <div class="blog">
                <div class="title">我的第一篇博客</div>
                <div class="date">2023-03-18</div>
                <div class="desc">今天开始，努力每天看两节课。Lorem ipsum dolor, sit amet consectetur adipisicing elit. Veniam quasi voluptatum dolor dolores deleniti incidunt tempora neque recusandae, autem sequi ipsum veritatis ipsa, esse iure quisquam cumque totam alias a. Lorem ipsum dolor sit amet consectetur, adipisicing elit. Possimus omnis, modi qui sequi reprehenderit numquam, mollitia, ducimus exercitationem officia nostrum explicabo tenetur quidem labore fugiat itaque. Dolore nihil doloribus animi!</div>
                <a href="./detail.html" class="detail">查看全文&gt;&gt;</a>
            </div>
            <div class="blog">
                <div class="title">我的第一篇博客</div>
                <div class="date">2023-03-18</div>
                <div class="desc">今天开始，努力每天看两节课。Lorem ipsum dolor, sit amet consectetur adipisicing elit. Veniam quasi voluptatum dolor dolores deleniti incidunt tempora neque recusandae, autem sequi ipsum veritatis ipsa, esse iure quisquam cumque totam alias a. Lorem ipsum dolor sit amet consectetur, adipisicing elit. Possimus omnis, modi qui sequi reprehenderit numquam, mollitia, ducimus exercitationem officia nostrum explicabo tenetur quidem labore fugiat itaque. Dolore nihil doloribus animi!</div>
                <a href="#" class="detail">查看全文&gt;&gt;</a>
            </div>
            <div class="blog">
                <div class="title">我的第一篇博客</div>
                <div class="date">2023-03-18</div>
                <div class="desc">今天开始，努力每天看两节课。Lorem ipsum dolor, sit amet consectetur adipisicing elit. Veniam quasi voluptatum dolor dolores deleniti incidunt tempora neque recusandae, autem sequi ipsum veritatis ipsa, esse iure quisquam cumque totam alias a. Lorem ipsum dolor sit amet consectetur, adipisicing elit. Possimus omnis, modi qui sequi reprehenderit numquam, mollitia, ducimus exercitationem officia nostrum explicabo tenetur quidem labore fugiat itaque. Dolore nihil doloribus animi!</div>
                <a href="#" class="detail">查看全文&gt;&gt;</a>
            </div> -->
            
        </div>
    </div>
    <script src="./js/jquery-3.3.1/jquery-3.3.1.min.js"></script>
    <script src="./js/common.js"></script>

    <script>

        $.ajax({
            type:"get",
            url:"blog",
            success: function(bodys){
                console.log(bodys);
                for(var body of bodys){
                    var blogDiv = document.createElement("div");
                    blogDiv.className = "blog";
                    //标题
                    var titleDiv  = document.createElement("div");
                    titleDiv.className = "title";
                    titleDiv.innerText = body.title;
                    blogDiv.append(titleDiv);
                    //日期
                    var dateDiv = document.createElement("div");
                    dateDiv.className = "date";
                    dateDiv.innerText = body.createTime;
                    blogDiv.append(dateDiv);
                    //摘要
                    var descDiv = document.createElement("div");
                    descDiv.className = "desc";
                    descDiv.innerText= body.content;
                    blogDiv.append(descDiv);
                    //查看全文
                    var detailDiv =  document.createElement("a");
                    detailDiv.className = "detail";
                    detailDiv.href = "detail.html?blogId="+body.id;
                    detailDiv.innerHTML = "查看全文&gt;&gt;";
                    blogDiv.append(detailDiv);

                    document.querySelector(".right").appendChild(blogDiv);
                }
            }
        })
        getUserInfo("list");

    </script>
</body>
</html>